package cn.jinjie.day06.menu1;

import java.util.ArrayList;
import java.util.Collection;

public class Demo1 {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        //添加
        list.add("111");
        list.add("222");
        list.add("33");
        list.add("444");
        list.add("555");
        System.out.println(list);
        //删除
        list.remove("555");
        System.out.println(list);
        //按条件删除
        // list.removeIf(new Predicate<String>() {
        //     @Override
        //     public boolean test(String s) {
        //         return false;
        //     }
        // });
        list.removeIf(s -> s.length() == 2);
        System.out.println(list);
        //包含
        System.out.println(list.contains("444"));
        System.out.println(list.size());
        // list.clear();
        System.out.println(list.isEmpty());

    }
}
